package com.pan.enume;

import java.lang.reflect.Field;
import java.util.Locale;

public class StatusLevel {
    /**
     * 0->无效订单 1->待付款；2->待发货；3->已发货；4->已收获
     */

    public static final String ORDER1_0 = "admin";
    public static final String ORDER1_1 = "admin";
    public static final String ORDER1_2 = "user";
    public static final String ORDER1_3 = "admin";
    public static final String ORDER1_4 = "user";
    /**
     * 0->无效订单 1->待付款；2->待发货；3->已发货；4->已收货
     */
    public static final String ORDER2_0 = "admin";
    public static final String ORDER2_1 = "admin";
    public static final String ORDER2_2 = "user";
    public static final String ORDER2_3 = "admin";
    public static final String ORDER2_4 = "user";
    /**
     * 0->无效订单 1->待付款；2->待发货；3->已发货；4->已收货
     */
    public static final String FREIGHT_0 = "admin";
    public static final String FREIGHT_1 = "admin";
    public static final String FREIGHT_2 = "user";
    public static final String FREIGHT_3 = "admin";
    public static final String FREIGHT_4 = "user";


    public String get(EntityEnum statusEnum,Integer status) throws NoSuchFieldException, IllegalAccessException {
        String fieldName = statusEnum.getName().toUpperCase();
        fieldName += ("_"+status);
        Field field = this.getClass().getDeclaredField(fieldName);
        String identity = (String) field.get(this);
        return identity;
    }

}
